import { PageContainer } from '@ant-design/pro-layout';
import { ActionType } from '@ant-design/pro-table';
import 'dayjs/locale/zh-cn';
import React, { useRef } from 'react';
import { useAccess } from 'umi';
import AddActive from './components/AddActive';
import TableActive from './components/TableActive';

export default (): React.ReactNode => {
  const access = useAccess();
  const actionRef = useRef<ActionType>();

  return (
    <PageContainer
      header={{
        breadcrumb: {},
        extra: [
          access.线索上报x主动报送x选题列表x上报线索 && (
            <AddActive
              key="add_active"
              onRefurbish={() => {
                actionRef.current?.reload();
              }}
            />
          ),
        ],
      }}
      subTitle=""
    >
      <TableActive actionRef={actionRef} />
    </PageContainer>
  );
};
